import wx
import wx.grid
import pandas as pd

"""

"""


class LineupTable(wx.grid.GridTableBase):
    # data = (('CF', 'Bob', 'Dernier'), ('2B', 'Ryne', 'Sandberg'),
    #         ('LF', 'Gary', 'Matthews'), ('1B', 'Leon', 'Durham'),
    #         ('RF', 'Keith', 'Moreland'), ('3B', 'Ron', 'Cey'),
    #         ('C', 'Jody', 'Davis'), ('SS', 'Larry', 'Bowa'),
    #         ('P', 'Rick', 'Sutcliffe'))

    # colLabels = ("last", "First", "")
    ex = pd.read_excel("../../fake2excel.xlsx")

    data = ex.values
    colLabels = ex.columns

    def __init__(self):
        wx.grid.GridTableBase.__init__(self)

    def IsEmpty(self, coords):
        return False

    def GetValue(self, row, col):
        return self.data[row][col]

    def SetValue(self, row, col, value):
        pass

    def GetRowLabelValue(self, row):
        return self.data[row][0]

    def GetColLabelValue(self, col):
        return self.colLabels[col]

    def GetNumberRows(self):
        return len(self.data)

    def GetNumberCols(self):
        return len(self.colLabels)


class SimpleGrid(wx.grid.Grid):
    def __init__(self, parent):
        wx.grid.Grid.__init__(self, parent, -1)
        self.SetTable(LineupTable(), True)


class MyFrame(wx.Frame):
    def __init__(self, parent):
        super().__init__(parent, -1, "A Grid", size=(275, 275))
        grp = SimpleGrid(self)


if __name__ == '__main__':
    app = wx.App()

    frame = MyFrame(None)
    frame.Show(True)

    app.MainLoop()
